var username = $("#username");
var password = $("#password");
var submit = $("#btn");
var error = $(".error");

submit.on("click",function(){
    $.ajax({
        url:"http://localhost/day21/03_login.php",
        type:"GET",
        data:{
            username:username.val(),
            password:password.val()
        }
    }).then(function(res){
        var ret = JSON.parse(res);
        if(ret.type === "error"){
            error.css({display:"block"});
        }else{
            location.href = "http://localhost:3000/index.html";
        }
    })
})